package com.apinji.unionpay.service;

import com.apinji.common.domain.wrapper.Reply;
import com.apinji.unionpay.dto.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by 轩辕夏夏 on 2017/7/1.
 *
 * 用戶銀行卡管理
 */
public interface BankCardService {

    /**
     * 查询用户常用卡
     * @param userUUID
     * @return
     */
    Reply getInUsedCards(String userUUID);

    /**
     * 根据银行卡号查询该卡是否已经开通过
     *
     * @param cardNo
     * @return
     */
    Reply isOpen(QueryIsOpenDto queryIsOpenDto);

    /**
     * 删除用户绑定的常用卡
     *
     * @param delUsedCardDto
     * @return
     */
    Reply delUserCard(DelUsedCardDto delUsedCardDto);

    /**
     * 银联支付后台开通时发送短信验证码到用户手机
     *
     * @param openCardSMSBackTokenDto
     * @return
     */
    Reply openCardSMSBackToken(OpenCardSMSBackTokenDto openCardSMSBackTokenDto);

    /**
     * 银联支付
     * token方式的后台开通，无需前台跳转到银联界面
     *
     * @param openCardBackTokenDto
     * @return
     */
    Reply openCardBackToken(OpenCardBackTokenDto openCardBackTokenDto) throws IOException;


    /**
     * 银联支付
     * token方式开通，跳转到银联界面进行开通
     *
     * @param openCardFrontTokenDto
     * @return
     */
    Reply openCardFrontToken(HttpServletRequest request, HttpServletResponse response, OpenCardFrontTokenDto openCardFrontTokenDto) throws IOException;
    Reply openCardFrontToken(HttpServletRequest request, HttpServletResponse response, String userUUID, String cardNo, String orderId, String frontUrl) throws IOException;


    /**
     * 跳转到银联界面开通卡号
     * 银联异步返回的通知消息
     *
     * @param request
     * @param response
     */
    void openCardFrontBackRcvResponse(HttpServletRequest request, HttpServletResponse response) throws IOException;


    /**
     * 跳转到银联界面开通回调(前台回调)-------------只用于测试
     * @param request
     * @param response
     * @throws IOException
     */
    String openCardFrontFrontRcvResponse(HttpServletRequest request, HttpServletResponse response) throws IOException;



}
